package com.jiot.common;

import java.util.Arrays;
import java.util.List;

/**
 * @author liling
 * @date 2020/10/10 15:09
 * @description 公共枚举类
 **/
public enum CommonEnum {
    ;

    /**
     * 角色类型
     */
    public enum Role {
        /**
         * 系统管理员
         */
        SYS_ADMIN(1, "系统管理员"),
        ADMIN(2, "普通管理员"),
        PROVINCE_ADMIN(3, "省管理员"),
        CITY_ADMIN(4, "市管理员"),
        DISTRICT_ADMIN(5, "区管理员"),
        APP(6, "app用户"),
        FUNCTIONAL(7, "职能用户"),
        ;

        private Integer num;
        private String name;

        Role(Integer num, String name) {
            this.num = num;
            this.name = name;
        }

    }

    /**
     * 通用数据状态
     */
    public enum DataStatus {
        /**
         * 未删除
         */
        NORMAL(0, "正常"),

        /**
         * 已删除
         */
        DELETE(1, "已删除"),

        LOGOUT(2, "注销"),
        ;
        private Integer status;
        private String description;

        DataStatus(Integer status, String description) {
            this.status = status;
            this.description = description;
        }
    }

    /**
     * api接口数据类型（请求数据、返回数据）
     */
    public enum IsRequest {
        /**
         * 请求数据
         */
        REQUEST(0, "请求数据"),

        /**
         * 返回数据
         */
        RESPONSE(1, "返回数据"),
        ;
        private Integer status;
        private String description;

        IsRequest(Integer status, String description) {
            this.status = status;
            this.description = description;
        }
    }

    /**
     * 用户留言来源
     */
    public enum MessageForm {
        /**
         * 官网
         */
        WEBSITES(1, "官网"),

        /**
         * 用户端
         */
        USERCLIENT(2, "用户端"),
        /**
         * 职能端
         */
        FUNCTIONSCLIENT(3, "职能端"),
        ;
        private Integer status;
        private String description;

        MessageForm(Integer status, String description) {
            this.status = status;
            this.description = description;
        }
    }


    /**
     * 通用数据状态
     */
    public enum NUMBER {
        /**
         * 0
         */
        ZERO(0, "数字0"),

        /**
         * 1
         */
        ONE(1, "数字1"),
        ;
        private Integer status;
        private String description;

        NUMBER(Integer status, String description) {
            this.status = status;
            this.description = description;
        }
    }

    /**
     * 用户状态
     */
    public enum UserStatus {
        /**
         * 正常
         */
        NORMAL(0, "正常"),
        DISABLE(1, "禁用"),
        ;
        private Integer status;
        private String description;

        UserStatus(Integer status, String description) {
            this.status = status;
            this.description = description;
        }

    }

    /**
     * 设备类型
     */
    public enum DeviceType {
        /**
         *
         */
        BREAKER(0, "断路器"),
        SMOKE(1, "烟感"),
        WATER_PRESSURE_MONITORING(2, "水压监测");
        private Integer type;
        private String description;

        DeviceType(Integer type, String description) {
            this.type = type;
            this.description = description;
        }
    }

    /**
     * 排序类型
     */
    
    public enum SortType {
        /**
         *
         */
        ASC("0", "升序"),
        DESC("1", "降序");
        private String type;
        private String description;

        SortType(String type, String description) {
            this.type = type;
            this.description = description;
        }
    }

    /**
     * 设备型号
     */
    
    public enum DeviceModel {
        /**
         *
         */
        Simplex(0, "单相"),
        Three_phase(1, "三相"),
        Plastic_case(2, "塑壳"),
        ;
        private Integer type;
        private String description;

        DeviceModel(Integer type, String description) {
            this.type = type;
            this.description = description;
        }
    }

    /**
     * 工单类型
     */
    
    public enum WorkOrderType {
        /**
         * 维修工单
         */
        REPAIR(0, "维修工单"),
        /**
         * 新装工单
         */
        INSTALL(1, "新装工单"),
        /**
         * 巡检工单
         */
        CHECKING(2, "巡检工单"),
        ;
        private Integer type;
        private String description;

        WorkOrderType(Integer type, String description) {
            this.type = type;
            this.description = description;
        }
    }

    /**
     * 工单状态
     */
    
    public enum WorkOrderStatus {
        /**
         * 未接单
         */
        NO_ORDERS(0, "未接单"),
        ORDERS(1, "已接单"),
        COMPLETED(5, "已完成"),
        ;
        private Integer status;
        private String description;

        WorkOrderStatus(Integer status, String description) {
            this.status = status;
            this.description = description;
        }
    }

    
    public enum DocumentType {
        /**
         * app背景图
         */
        APP_BACKGROUND_PIC(0, "app背景图"),
        PRODUCT_BANNER(1, "产品banner"),
        USER_AVATAR(2, "用户头像"),
        PRODUCT_PAGE_IMG(3, "推荐产品封面图"),
        PRODUCT_IMG(4, "产品图"),
        GUIDANCE_IMG(5, "新手上路（解答图片）"),
        ;
        private Integer type;
        private String description;

        DocumentType(Integer type, String description) {
            this.type = type;
            this.description = description;
        }
    }

    
    public enum ProductType {
        /**
         * app背景图
         */
        RECOMMEND_PRODUCT(Byte.valueOf("0"), "推荐产品"),
        PRODUCT(Byte.valueOf("1"), "产品"),
        ;
        private Byte type;
        private String description;

        ProductType(Byte type, String description) {
            this.type = type;
            this.description = description;
        }
    }

    /**
     * 支付类型
     */
    
    public enum PayType {
        /**
         * 优惠券抵扣
         */
        DEDUCTION(0, "优惠券抵扣"),
        ;
        private Integer type;
        private String description;

        PayType(Integer type, String description) {
            this.type = type;
            this.description = description;
        }
    }

    
    public enum ReleaseType {
        /**
         * 资讯发布状态
         */
        UNPUBLISHED(0, "未发布"),
        PUBLISHED(1, "已发布"),
        ;
        private Integer type;
        private String description;

        ReleaseType(Integer type, String description) {
            this.type = type;
            this.description = description;
        }
    }

    
    public enum WorkInfoType {
        /**
         * 基础费用
         */
        BASE_INFO(0, "基础费用"),
        /**
         * 修理设备
         */
        REPAIR_DEVICE(1, "修理设备"),
        INSTALL_DEVICE(2, "安装新设备"),
        ;
        private Integer type;
        private String description;

        WorkInfoType(Integer type, String description) {
            this.type = type;
            this.description = description;
        }
    }

    /**
     * 阈值参数
     */
    
    public enum hresholdParameter {
        /**
         *
         */
        WIRE_DIAMETER(0, "电线线径"),
        COPPER_AND_ALUMINUM_MIXED(1, "铜铝混用"),
        WHETHER_TO_WEAR_ATUBE(2, "是否穿管"),
        ;
        private Integer type;
        private String description;

        hresholdParameter(Integer type, String description) {
            this.type = type;
            this.description = description;
        }
    }

    /**
     * 电线线径
     */
    
    public enum wirePath {
        /**
         *
         */
        WIRE_PATH_A(0, "自定义"),
        WIRE_PATH_b(1, "1mm²"),
        WIRE_PATH_c(2, "1.5mm²"),
        WIRE_PATH_d(3, "2.5mm²"),
        WIRE_PATH_e(4, "4mm²"),
        WIRE_PATH_f(5, "6mm²"),
        WIRE_PATH_g(6, "10mm²"),
        WIRE_PATH_h(7, "16mm²"),
        ;

        private Integer type;
        private String description;

        wirePath(Integer type, String description) {
            this.type = type;
            this.description = description;
        }
    }

    /**
     * 是否穿管
     */
    
    public enum whetherToWearAtube {
        /**
         *
         */
        PVC(0, "PVC"),
        IRON_TUBE(1, "铁管"),
        NOT_CLEAR(2, "不清楚"),
        ;

        private Integer type;
        private String description;

        whetherToWearAtube(Integer type, String description) {
            this.type = type;
            this.description = description;
        }
    }

    /**
     * 铜铝混用
     */
    
    public enum copperAndAluminumMixed {
        /**
         *
         */
        YES(0, "是"),
        NO(1, "否"),
        NOT_CLEAR(2, "不清楚"),
        ;

        private Integer type;
        private String description;

        copperAndAluminumMixed(Integer type, String description) {
            this.type = type;
            this.description = description;
        }
    }

    /**
     * 告警信息状态
     */
    
    public enum AlarmInfoStatus {
        /**
         * 报警中
         */
        ALARMING(0, "正在报警"),
        PROCESSING(1, "正在处理"),
        COMPLETE(2, "已完成"),
        IGNORE(3, "已忽略"),
        ;

        private Integer status;
        private String description;

        AlarmInfoStatus(Integer status, String description) {
            this.status = status;
            this.description = description;
        }

    }

    
    public enum ServerStatus {
        /**
         * 停用
         */
        DEACTIVATE(0, "停用"),
        /**
         * 正在服务
         */
        SERVING(1, "正在服务"),
        ;

        private Integer status;
        private String description;

        ServerStatus(Integer status, String description) {
            this.status = status;
            this.description = description;
        }
    }

    /**
     * 报警类型
     */
    
    public enum AlarmType {

        /**
         * 报警类型
         */
        BIT_ZERO(0, "A相过压报警"),
        BIT_ONE(1, "A相欠压报警"),
        BIT_TWO(2, "B相过压报警"),
        BIT_THREE(3, "B相欠压报警"),
        BIT_FOUR(4, "C相过压报警"),
        BIT_FIVE(5, "C相欠压报警"),
        BIT_SIX(6, "A相过流报警"),
        BIT_SEVEN(7, "B相过流报警"),
        BIT_EIGHT(8, "C相过流报警"),
        BIT_NINE(9, "线路温度报警"),
        BIT_TEN(10, "设备温度报警"),
        BIT_ELEVEN(11, "剩余电流过流报警"),
//        BIT_TWELVE(12, "未下发指令分闸报警"),
        BIT_TWELVE(12, "设备短路"),
        BIT_THIRTEEN(13, "预留"),
        BIT_FOURTEEN(14, "预留"),
        BIT_FIFTEEN(15, "预留"),
        ;
        private Integer bit;
        private String alarmName;

        AlarmType(Integer bit, String alarmName) {
            this.bit = bit;
            this.alarmName = alarmName;
        }

        
    }

    /**
     * 设备在线离线状态
     */
    
    public enum DeviceOnline {
        /**
         * 设备在线离线状态
         */
        OFFLINE(0, "离线"),
        ONLINE(1, "在线"),
        ;
        private Integer status;
        private String description;

        DeviceOnline(Integer status, String description) {
            this.status = status;
            this.description = description;
        }
    }

    
    public enum UserTimeType {
        /**
         *
         */
        BIND_DEVICE(0, "绑定设备"),
        ;
        private Integer type;
        private String description;

        UserTimeType(Integer type, String description) {
            this.type = type;
            this.description = description;
        }
    }

    /**
     * 查询历史数据类型
     */
    
    public enum HistoryTimeType {
        /**
         * 今天
         */
        TODAY(0, "今天"),
        YESTERDAY(1, "昨天"),
        WEEK_AGO(2, "近七天"),
        MONTH_AGO(3, "一个月"),
        THREE_MONTH_AGO(4, "三个月"),
        ;
        private Integer type;
        private String description;

        HistoryTimeType(Integer type, String description) {
            this.type = type;
            this.description = description;
        }
    }

    
    public enum HistoryDataType {
        /**
         *
         */
        Va(0, "a相电压"),
        Vb(1, "b相电压"),
        Vc(2, "c相电压"),
        Ia(3, "a相电流"),
        Ib(4, "b相电流"),
        Ic(5, "c相电流"),
        If(6, "漏电流"),
        Ta(7, "a线温度"),
        Tb(8, "b线温度"),
        Tc(9, "c线温度"),
        Td(10, "设备温度"),
        Pa(11, "功率"),
        Pfa(12, "功率因数"),
        ;
        private Integer type;
        private String description;

        HistoryDataType(Integer type, String description) {
            this.type = type;
            this.description = description;
        }
    }

    
    public enum ThresholdEnabledState {
        /**
         * 阈值启用状态
         */

        SHUT_DOWN(0, "关闭"),
        TURN_ON(1, "启用"),
        ;
        private Integer type;
        private String description;

        ThresholdEnabledState(Integer type, String description) {
            this.type = type;
            this.description = description;
        }
    }

    
    public enum Threshold {
        /**
         * 阀值分闸控制
         */
        FC("Fc", "阀值分闸控制"),
        IaOT("IaOT", "A相过流保护阈值"),
        IfOT("IfOT", "剩余电流过流阈值"),
        TlH("TlH", "线路温度阈值"),
        ;
        private String key;
        private String description;
        Threshold(String key, String description) {
            this.key = key;
            this.description = description;
        }

        
    }

    
    public enum UserDeviceDurationBindingStatus {

        /**
         * 用户设备绑定时长状态
         */
        UNBOUND(0, "未绑定"),
        BOUND(1, "已绑定"),
        ;
        private Integer type;
        private String description;

        UserDeviceDurationBindingStatus(Integer type, String description) {
            this.type = type;
            this.description = description;
        }
    }

    /**
     * 电量对比
     */
    
    public enum PowerCompareType {
        /**
         * 天
         */
        DAY(0, "天"),
        WEEK(1, "周"),
        MONTH(2, "月"),
        YEAR(3, "年"),
        ;

        private Integer type;
        private String description;

        PowerCompareType(Integer type, String description) {
            this.type = type;
            this.description = description;
        }

        
    }

    
    public enum DeviceStatus {
        /**
         * 设备状态
         */
        NORMAL(0, "正常"),
        WARNING(1, "预警"),
        ALARM(2, "报警"),
        OFFLINE(3, "离线"),
        DEACTIVATE(4, "停用"),
        ;

        private Integer status;
        private String description;

        DeviceStatus(Integer status, String description) {
            this.status = status;
            this.description = description;
        }
    }

    
    public enum OrderPaymentStatus {
        /**
         * 订单支付状态
         */
        UNPAID(0, "未支付"),
        PAID(1, "已支付"),
        ;
        private Integer status;
        private String description;

        OrderPaymentStatus(Integer status, String description) {
            this.status = status;
            this.description = description;
        }
    }

    
    public enum TriggerStatus {
        /**
         * 定时任务启动状态
         */
        STOP(0, "停止"),
        START(1, "启动"),
        ;

        private Integer status;
        private String description;

        TriggerStatus(Integer status, String description) {
            this.status = status;
            this.description = description;
        }
    }

    
    public enum OrderBy {
        /**
         * 倒叙
         */
        DESC(0, "倒叙"),
        ASC(1, "正序"),
        ;

        private Integer orderBy;
        private String description;

        OrderBy(Integer orderBy, String description) {
            this.orderBy = orderBy;
            this.description = description;
        }

        
    }

    
    public enum AreaLevel {
        /**
         * 国家
         */
        COUNTRY(1, "国家"),
        PROVINCE(2, "省"),
        CITY(3, "市"),
        DISTRICT(4, "区"),
        ;

        private Integer level;
        private String description;

        AreaLevel(Integer level, String description) {
            this.level = level;
            this.description = description;
        }

       
    }

    
    public enum RoleType {
        /**
         * 系统自带
         */
        SYSTEM(0, "系统自带"),
        USER_ADD(1, "用户创建"),
        ;

        private Integer type;
        private String description;

        RoleType(Integer type, String description) {
            this.type = type;
            this.description = description;
        }
    }

    
    public enum InspectTypeInfo {
        /**
         *
         */
        NOTICE(0, "通知自检整改"),
        ;
        private Integer type;
        private String info;

        InspectTypeInfo(Integer type, String info) {
            this.type = type;
            this.info = info;
        }
    }

    
    public enum ReportDeviceStatus {
        /**
         * 离线
         */
        OFFLINE(0, "离线"),
        ONLINE(1, "在线"),
        WARNING(2, "报警"),
        ADMONITION(3, "预警"),
        ;
        private Integer status;
        private String description;

        ReportDeviceStatus(Integer status, String description) {
            this.status = status;
            this.description = description;
        }

        
    }

    
    public enum AlarmScoreLevel {
        /**
         * 降低
         */
        DOWN(-1, "降低"),
        BALANCE(0, "持平"),
        UP(1, "上升"),
        ;
        private Integer level;
        private String description;

        AlarmScoreLevel(Integer level, String description) {
            this.level = level;
            this.description = description;
        }

        
    }

    
    public enum ReportType {
        /**
         * 周报
         */
        WEEK(0, "周报"),
        MONTH(1, "月报"),
        ;
        private Integer type;
        private String description;

        ReportType(Integer type, String description) {
            this.type = type;
            this.description = description;
        }
    }

    
    public enum BindPhone {
        /**
         *
         */
        UNBIND(1, "未绑定"),
        BIND(2, "已绑定"),
        ;
        private Integer status;
        private String description;

        BindPhone(Integer status, String description) {
            this.status = status;
            this.description = description;
        }
    }

    
    public enum AdminType {
        /**
         * 后台管理员
         */
        ADMIN(0, "后台管理员"),
        AREA_ADMIN(1, "区域管理员"),
        ;
        private Integer type;
        private String name;
        AdminType(Integer type, String name) {
            this.type = type;
            this.name = name;
        }
    }

    /**
     * 操作类型
     */
    
    public enum OperateType {
        ADD(0, "新增"),
        MOD(1, "修改"),
        DEL(2, "删除"),
        QUERY(3, "查询"),
        ;
        private Integer type;
        private String name;
        OperateType(Integer type, String name) {
            this.type = type;
            this.name = name;
        }
    }

    
    public enum SuccessStatus {
        /**
         * 失败
         */
        FAILED(0, "失败"),
        SUCCESS(1, "成功"),
        ;
        private Integer status;
        private String description;
        SuccessStatus(Integer status, String description) {
            this.status = status;
            this.description = description;
        }
    }
}
